package com.hainingtong.user.service.impl;

import com.hainingtong.user.dao.PermissionGroupMapper;
import com.hainingtong.user.entity.SysPermissionGroup;
import com.hainingtong.user.exception.NicknameExistsException;
import com.hainingtong.user.service.PermissionGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class PermissionGroupServiceImpl implements PermissionGroupService {

    @Autowired
    PermissionGroupMapper groupMapper;

    @Transactional
    @Override
    public int insert(String name) {
        SysPermissionGroup group = new SysPermissionGroup();
        group.setName(name);
        groupMapper.insert(group);
        throw new NicknameExistsException();
//        return 0;
    }
}
